1. Technical Field
The present invention is directed to a method and apparatus for dynamically building a context sensitive composite icon. More specifically, the present invention provides a mechanism for dynamically displaying information in the form of a base icon and icon additions based on data associated with the base icon and a context in which the icon is being used.
2. Description of Related Art
Icons are small, pictorial, on-screen representation of an object, such as a document, program, folder, disk drive, or the like, in a graphical user interface (GUI). Icons generally resemble some aspect of the object that they represent. In this way, the icon provides a minimal amount of information regarding the object with which it is associated.
FIG. 1 illustrates some exemplary known icons used in a Microsoft Windows™ operating environment. As shown in FIG. 1, the icon 110 is associated with the application used for setting and obtaining information about the network properties of the computer. The icon 110 represents two computers connected via a cable and thus, the graphical depiction provides information identifying the object with which it is associated. Similarly, the icon 120 is associated with an inbox application and graphically represents a physical inbox that would be present on a person's desk. Likewise, the icon 130 is associated with a recycling program and graphically represents a physical recycling trash can.
Typically, icon representations are defined long before they are used. That is, an application developer will define static icons that may be used to represent the object. The range of expression for an icon is limited with some being completely constant and some changing within a fixed set of representations. In other words, icons typically do not change or may be switched with other static replacement icons to give the impression that the icon has changed.
For example, the recycle bin icon 130 discussed above may have a first icon that graphically depicts an empty recycling bin when there are no files designated for recycling. When one or more files have been designated for recycling, however, the icon 130 may be switched to another static icon representing a full recycling bin, such as that depicted in FIG. 1.
Also, in order to provide entertainment value, animated icons are known to be used in which a series of static icons are quickly switched to give the illusion of movement within the icon. Such animated icons are available, for example, in Microsoft Windows Plus!™ and Icon Hear-It 98™, available from Moon Valley Software.
In addition, icon overlays, which are small images placed at the lower-left corner of the icon and represent a Shell object, are generally known in the art and are used to provide extra information regarding the object with which the icon is associated. For example, a commonly used icon overlay is the small arrow 150 that indicates that the icon represents a link, rather than the actual file or folder. In addition to the standard icon overlays, an application developer can generate custom icon overlays for specified Shell objects by implementing and registering an icon overlay handler. Information regarding icon overlays, some of which is reproduced herein below, may be obtained from Microsoft Corporation and the Microsoft Developer Network website.
Icon overlay handlers are Component Object Model (COM) objects that are associated with a particular icon overlay. All communication between the Shell and the handler takes place through the handler's IShellIconOverlayIdentifier interface. When the Shell starts up, it initializes all icon overlay handlers by calling two of their IShellIconOverlayIdentifier methods:
(1) the Shell calls GetOverlayInfo to request the location of the handler's icon overlay. The icon overlay handler returns the name of the file containing the overlay image, and its index within that file. The Shell then adds the icon overlay to the system image list; and
(2) the Shell calls GetPriority to determine the icon overlay's priority. The priority value is a number from zero to 100, with 100 indicating the lowest priority. If more than one icon overlay is requested for a particular file, the Shell uses this value to help it determine which icon overlay to display.
Before painting an object's icon, the Shell passes the object's name to each icon overlay handler's IsMemberOf method. An icon overlay handler is normally associated with a particular group of files. For example, the icon overlay handler might request an overlay for all members of a file class, such as all files with an .myp file name extension. If a handler wants to have its icon overlay displayed, it returns S_OK. The Shell then calls the handler's GetOverlayInfo method to determine which icon to display.
It should be noted that once the image has been loaded into the system image list during initialization, it cannot be changed. After initialization, the file name and index are used only to identify the icon overlay. The system will not load a new icon overlay. When GetOverlayInfo is called, the handler must return the same file name and index that was specified when the function was first called.
Although only one icon overlay can be displayed, it is possible for an object to have icon overlays requested by more than one handler. In that case, the Shell resolves the conflict by displaying the highest priority icon overlay. The Shell resolves many such conflicts with an internal set of rules. If these rules are not sufficient, the Shell compares the priority values that were specified by the handlers' GetPriority method during initialization.
Thus, while icon overlays may be used in known systems to provide additional information about a shell object, these icon overlays are limited in that only a single icon overlay may be displayed, the icon overlay is limited to a single position on the original icon, and the icon overlay is fixed once the icon image has been loaded into the system image list. Furthermore, such icon overlays do not provide any information regarding the context in which the icon is being used. Rather, they merely provide a fixed representation of a shell object.
Thus, it would be beneficial to have an improved method and apparatus for dynamically building a context sensitive composite icon that is changeable based on the context in which the icon is used.